home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / rexx / circle / LensFlare.rx < prev    next >
Text File  |  2002-12-07  |  16KB  |  707 lines

  1. /*
  2.     Draw and Anim Lens Flare
  3.     V1.1
  4. */
  5.  
  6.     call addlib("rexxmathlib.library", 5, -30, 0)
  7.  
  8.     options results
  9.   parse ARG Port x1 y1 r2 b
  10.     ADDRESS value Port
  11.  
  12.     pp_CountFrames
  13.     Total_Frame=result
  14.     if Total_Frame=0 then Total_Frame=1
  15.     Start_Frame=1
  16.     End_Frame=Total_Frame
  17.  
  18.     pp_GetDepth
  19.     Dp=result
  20.     if Dp<24 then DO
  21.         pp_Warn 'This*script*is*only|for*24bits*Picture.'    
  22.         pp_PermitRefresh
  23.         Exit
  24.     END
  25.  
  26.     Anim=0;Path=0;Type=0
  27.     Light=0
  28.     Start_B1=100;End_B1=100
  29.     Start_B2=48;End_B2=48
  30.     Start_S=r2;End_S=r2
  31.     Arti=1
  32.     Glob=0
  33.  
  34.     Pi=3.1415926/180
  35.     totalR=r2*2
  36.     RayShade=100-Start_B1
  37.     NbStar=8
  38.  
  39.     ADDRESS COMMAND
  40.     file="T:pp_lens"
  41.     IF OPEN('b',file,'R') then DO
  42.         Anim=READLN('b')
  43.         Path=READLN('b')
  44.         Type=READLN('b')
  45.         Light=READLN('b')
  46.         Start_B1=READLN('b')
  47.         End_B1=READLN('b')
  48.         Start_B2=READLN('b')
  49.         End_B2=READLN('b')
  50.         Arti=READLN('b')
  51.         Glob=READLN('b')
  52.         CALL CLOSE('b')
  53.     END
  54.  
  55.     ADDRESS value Port
  56.     R=-1
  57.  
  58. DO UNTIL R>-1
  59.  
  60.     pp_DialogInit 250 270 "*LENS*FLARE*" 10
  61.     pp_Cycle 0 70 5 100 16 "Animation" 1 "No|Yes" Anim
  62.     pp_Cycle 1 70 35 100 16 "Path" 1 "None|Left|Right|Up|Down" Path
  63.     pp_Cycle 2 70 53 100 16 "Type" 1 "In|Out" Type
  64.     pp_Button 3 20 71 200 16 '*Frame*(*#'||Start_Frame||'->#'||End_Frame||'*)*'
  65.     
  66.     pp_Cycle 4 70 100 100 16 "Light" 1 "Rays|Glow|Star" Light
  67.     pp_Button 5 20 118 200 16 '*Brightness*(*'||Start_B1||'*->*'||End_B1||'*)*'
  68.     pp_Button 6 20 136 200 16 '*Size*(*'||Start_S||'*->*'||End_S||'*)*'
  69.  
  70.     pp_Cycle 7 70 165 100 16 "Artifacts" 1 "None|Standard|Spot|Spot2" Arti
  71.  
  72.     pp_Cycle 8 70 194 100 16 "Globals" 1 "Red|Blue|Yellow|White" Glob
  73.     pp_Button 9 20 212 200 16 '*Brightness*(*'||Start_B2||'*->*'||End_B2||'*)*'
  74.     
  75.     pp_Dialog
  76.     R=result
  77.  
  78.     pp_GetDialog 0
  79.     Anim=result
  80.  
  81.     pp_GetDialog 1
  82.     Path=result
  83.  
  84.     pp_GetDialog 2
  85.     Type=result
  86.  
  87.     pp_GetDialog 4
  88.     Light=result
  89.  
  90.     pp_GetDialog 7
  91.     Arti=result
  92.  
  93.     pp_GetDialog 8
  94.     Glob=result
  95.  
  96.     if R=-3 then DO
  97.         pp_DialogInit 150 80 "*FRAME*" 2
  98.             pp_Integer 0 60 5 50 16 "Start" 1 Start_Frame
  99.             pp_Integer 1 60 25 50 16 "End" 1 End_Frame
  100.         pp_Dialog
  101.         rc=result
  102.         IF rc=1 then DO
  103.             pp_GetDialog 0
  104.             Start_Frame=result
  105.  
  106.             pp_GetDialog 1
  107.             End_Frame=result
  108.  
  109.             IF End_Frame>Total_Frame THEN DO
  110.                 End_Frame=Total_Frame
  111.             END
  112.  
  113.             IF Start_Frame>End_Frame THEN DO
  114.                 Start_Frame=1
  115.             END
  116.  
  117.         END            
  118.     END
  119.  
  120.     if R=-5 then DO
  121.         if Anim=1 then DO
  122.             pp_DialogInit 150 75 "*LIGHT.BRIGHTNESS*" 2
  123.             pp_Integer 0 60 5 50 16 "Start" 1 Start_B1
  124.             pp_Integer 1 60 25 50 16 "End" 1 End_B1
  125.             pp_Dialog
  126.             rc=result
  127.             IF rc=1 then DO
  128.                 pp_GetDialog 0
  129.                 Start_B1=result
  130.                 pp_GetDialog 1
  131.                 End_B1=result        
  132.             END
  133.         END
  134.         ELSE DO
  135.             pp_DialogInit 150 55 "*LIGHT.BRIGHTNESS*" 1
  136.             pp_Integer 0 75 5 50 16 "Brightness" 1 Start_B1
  137.             pp_Dialog
  138.             rc=result
  139.             IF rc=1 then DO
  140.                 pp_GetDialog 0
  141.                 Start_B1=result
  142.                 End_B1=result        
  143.             END
  144.         END            
  145.     END
  146.  
  147.     if R=-6 then DO
  148.         if Anim=1 then DO
  149.             pp_DialogInit 150 75 "*LIGHT.SIZE*" 2
  150.             pp_Integer 0 60 5 50 16 "Start" 1 Start_S
  151.             pp_Integer 1 60 25 50 16 "End" 1 End_S
  152.             pp_Dialog
  153.             rc=result
  154.             IF rc=1 then DO
  155.                 pp_GetDialog 0
  156.                 Start_S=result
  157.                 pp_GetDialog 1
  158.                 End_S=result        
  159.             END
  160.         END
  161.         ELSE DO
  162.             pp_DialogInit 150 55 "*LIGHT.SIZE*" 1
  163.             pp_Integer 0 60 5 50 16 "Size" 1 Start_S
  164.             pp_Dialog
  165.             rc=result
  166.             IF rc=1 then DO
  167.                 pp_GetDialog 0
  168.                 Start_S=result
  169.                 End_S=result        
  170.             END
  171.         END            
  172.     END
  173.  
  174.     if R=-9 then DO
  175.         if Anim=1 then DO
  176.             pp_DialogInit 150 75 "*GLOBAL.BRIGHTNESS*" 2
  177.             pp_Integer 0 60 5 50 16 "Start" 1 Start_B2
  178.             pp_Integer 1 60 25 50 16 "End" 1 End_B2
  179.             pp_Dialog
  180.             rc=result
  181.             IF rc=1 then DO
  182.                 pp_GetDialog 0
  183.                 Start_B2=result
  184.                 pp_GetDialog 1
  185.                 End_B2=result        
  186.             END
  187.         END
  188.         ELSE DO
  189.             pp_DialogInit 150 55 "*GLOBAL.BRIGHTNESS*" 1
  190.             pp_Integer 0 75 5 50 16 "Brightness" 1 Start_B2
  191.             pp_Dialog
  192.             rc=result
  193.             IF rc=1 then DO
  194.                 pp_GetDialog 0
  195.                 Start_B2=result
  196.                 End_B2=result        
  197.             END
  198.         END            
  199.     END
  200. END
  201.  
  202.     if R=0 then DO
  203.         EXIT
  204.     END    
  205.  
  206.     if End_Frame<2 then do
  207.         if Anim=1 then DO
  208.             pp_Warn 'Make*an*Anim*first.'
  209.             EXIT
  210.         end
  211.     end
  212.  
  213.     ADDRESS COMMAND
  214.  
  215.     file='t:pp_lens'
  216.  
  217.     IF EXISTS(file) THEN DO
  218.         'delete >nil: t:pp_lens'
  219.     END
  220.  
  221.     IF OPEN('c',file,'W') then DO
  222.         CALL WRITELN('c',Anim)
  223.         CALL WRITELN('c',Path)
  224.         CALL WRITELN('c',Type)
  225.         CALL WRITELN('c',Light)
  226.         CALL WRITELN('c',Start_B1)
  227.         CALL WRITELN('c',End_B1)
  228.         CALL WRITELN('c',Start_B2)
  229.         CALL WRITELN('c',End_B2)
  230.         CALL WRITELN('c',Arti)
  231.         CALL WRITELN('c',Glob)
  232.         CALL CLOSE('c')
  233.     END
  234.  
  235.     ADDRESS value Port
  236.  
  237.     pp_AliasOn
  238.     pp_PenType 0
  239.     pp_ComposeReqOff
  240.  
  241.     pp_ClosestColor 0 0 0
  242.     color=result
  243.     pp_SetBpen color
  244.     pp_ClosestColor 255 255 255
  245.     color=result
  246.     pp_SetApen color
  247.  
  248.     pp_Compose 0 100 0    
  249.  
  250.     IF Anim=0 THEN DO
  251.         pp_SpareOnOff
  252.         pp_Cls
  253.  
  254.         r=Start_S
  255.         totalR=r*2
  256.         RayShade=100-Start_B1
  257.  
  258.         if Light=0 then CALL DrawRays()
  259.         if Light=1 then CALL DrawGlow()
  260.         if Light=2 then CALL DrawStar()
  261.  
  262.         pp_SpareOnOff
  263.         pp_UpdateUndo
  264.         pp_EffectOn
  265.  
  266.         pp_Compose 1 100 0    
  267.         pp_Gradient 10 2 x1 y1
  268.  
  269.         pp_ClearRange 10
  270.         pp_setRange 10 0 0 0 0
  271.         pp_setRange 10 4 0 0 0
  272.  
  273.         if Glob=0 then pp_setRange 10 16 Start_B2 0 0
  274.         if Glob=1 then pp_setRange 10 16 0 0 Start_B2
  275.         if Glob=2 then pp_setRange 10 16 Start_B2 Start_B2 0
  276.         if Glob=3 then pp_setRange 10 16 Start_B2 Start_B2 Start_B2
  277.  
  278.         pp_setRange 10 19 Start_B2 Start_B2 Start_B2
  279.         pp_CircleF x1 y1 TotalR
  280.  
  281.         pp_Spare
  282.         pp_Compose 1 100 0
  283.         pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  284.  
  285.         if Arti>0 then CALL DrawArtefacts()
  286.         
  287.     END
  288.     ELSE DO
  289.  
  290.         pp_GetWidth
  291.         W=result
  292.  
  293.         pp_GetHeight
  294.         H=result
  295.  
  296.         HX=r2
  297.         HY=r2
  298.  
  299.         Start_X=x1
  300.         End_X=x1
  301.         Start_Y=y1
  302.         End_Y=y1
  303.  
  304.         IF Path=1 then DO
  305.             IF Type=0 then DO
  306.                 Start_X=HX*-1
  307.             END
  308.             ELSE DO
  309.                 End_X=HX*-1
  310.             END
  311.         END
  312.  
  313.         IF Path=2 then DO
  314.             IF Type=0 then DO
  315.                 Start_X=W+HX
  316.             END
  317.             ELSE DO
  318.                 End_X=W+HX
  319.             END
  320.         END
  321.  
  322.         IF Path=3 then DO
  323.             IF Type=0 then DO
  324.                 Start_Y=HY*-1
  325.             END
  326.             ELSE DO
  327.                 End_Y=HY*-1
  328.             END
  329.         END
  330.  
  331.         IF Path=4 then DO
  332.             IF Type=0 then DO
  333.                 Start_Y=H+HY
  334.             END
  335.             ELSE DO
  336.                 End_Y=H+HY
  337.             END
  338.         END
  339.  
  340.         step=(End_Frame-Start_Frame)
  341.  
  342.         Step_B1=(End_B1-Start_B1)/Step
  343.         Step_B2=(End_B2-Start_B2)/Step
  344.         Step_S=(End_S-Start_S)/Step
  345.         Step_X=(End_X-Start_X)/Step
  346.         Step_Y=(End_Y-Start_Y)/Step
  347.  
  348.  
  349.  
  350.         DO i=Start_Frame to End_Frame
  351.             pp_GotoFrame i
  352.             r=trunc(Start_S+Step_S*(i-Start_Frame)+0.5,0)
  353.             RayShade=100-trunc(Start_B1+Step_B1*(i-Start_Frame)+0.5,0)
  354.             B2=trunc(Start_B2+Step_B2*(i-Start_Frame)+0.5,0)            
  355.             x1=trunc(Start_X+Step_X*(i-Start_Frame)+0.5,0)
  356.             y1=trunc(Start_Y+Step_Y*(i-Start_Frame)+0.5,0)
  357.  
  358.             pp_SpareOnOff
  359.             pp_Cls
  360.  
  361.             totalR=r*2
  362.  
  363.             if Light=0 then CALL DrawRays()
  364.             if Light=1 then CALL DrawGlow()
  365.             if Light=2 then CALL DrawStar()
  366.  
  367.             pp_SpareOnOff
  368.             pp_EffectOn
  369.  
  370.             pp_Compose 1 100 0    
  371.             pp_Gradient 10 2 x1 y1
  372.  
  373.             pp_ClearRange 10
  374.             pp_setRange 10 0 0 0 0
  375.             pp_setRange 10 4 0 0 0
  376.  
  377.             if Glob=0 then pp_setRange 10 16 B2 0 0
  378.             if Glob=1 then pp_setRange 10 16 0 0 B2
  379.             if Glob=2 then pp_setRange 10 16 B2 B2 0
  380.             if Glob=3 then pp_setRange 10 16 B2 B2 B2
  381.  
  382.             pp_setRange 10 19 B2 B2 B2
  383.             pp_CircleF x1 y1 TotalR
  384.  
  385.             pp_Spare
  386.             pp_Compose 1 100 0
  387.             pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  388.  
  389.             if Arti>0 then CALL DrawArtefacts()
  390.         END
  391.         pp_GotoFrame Start_Frame
  392.     END
  393.  
  394.     pp_Compose 0 100 0
  395.     pp_EffectOff
  396.     pp_ComposeReqOn
  397.  
  398.  
  399. EXIT
  400.     
  401. /*********************************************************/
  402. /*                       Draw Star                       */
  403. /*********************************************************/
  404.  
  405. DrawStar: PROCEDURE EXPOSE x1 y1 r Pi totalR NbStar RayShade
  406.  
  407.     pp_Compose 0 100 0
  408.     pp_EffectOff
  409.     r2=4
  410.     a=360/NbStar
  411.     a2=a/2
  412.  
  413.   DO i=0 To 359 by a
  414.         r3=r
  415.  
  416.       x = Sin(i*Pi)*r3+x1
  417.     y = Cos(i*Pi)*r3+y1
  418.  
  419.         ii=i+a2
  420.       x2 = Sin(ii*Pi)*r2+x1
  421.     y2 = Cos(ii*Pi)*r2+y1
  422.  
  423.         ii=i-a2
  424.       x3 = Sin(ii*Pi)*r2+x1
  425.     y3 = Cos(ii*Pi)*r2+y1
  426.  
  427.         pp_StartPoly
  428.         pp_AddPoly trunc(x3+0.5) trunc(y3+0.5)
  429.         pp_AddPoly trunc(x2+0.5) trunc(y2+0.5)
  430.         pp_AddPoly trunc(x+0.5) trunc(y+0.5)
  431.         pp_EndPolyF
  432.  
  433.     END
  434.  
  435.     pp_EffectOn
  436.     rr=trunc(r/6)
  437.     if rr<3 then rr=3
  438.     pp_Airbrush 100 rr
  439.  
  440.  
  441.     pp_CircleF x1 y1 rr
  442.  
  443.     pp_EffectOn
  444.     pp_ConvInit 1 25 0
  445.     pp_Conv 0 1 1 1 1 1
  446.     pp_Conv 1 1 1 1 1 1
  447.     pp_Conv 2 1 1 1 1 1
  448.     pp_Conv 3 1 1 1 1 1
  449.     pp_Conv 4 1 1 1 1 1    
  450. /*    
  451.     pp_ConvInit 1 159 0    
  452.     pp_Conv 0 2 4 5 4 2
  453.     pp_Conv 1 4 9 12 9 4
  454.     pp_Conv 2 5 12 15 12 5
  455.     pp_Conv 3 4 9 12 9 4
  456.     pp_Conv 4 2 4 5 4 2
  457. */
  458.  
  459.     pp_BoxF x1-r-2 y1-r-2 x1+r+2 y1+r+2
  460.     pp_BoxF x1-r-2 y1-r-2 x1+r+2 y1+r+2
  461.  
  462.  
  463.     if RayShade >0 then DO
  464.     pp_Shade RayShade
  465.     pp_BoxF x1-r-2 y1-r-2 x1+r+2 y1+r+2
  466.     END
  467.  
  468. RETURN
  469.  
  470. /*********************************************************/
  471. /*                       Draw Glow                       */
  472. /*********************************************************/
  473. DrawGlow: PROCEDURE EXPOSE x1 y1 r Pi totalR RayShade
  474.     pp_EffectOn
  475.     AB=r*0.5
  476.     if AB>20 then AB=20
  477.     if AB<2 then AB=2
  478.     
  479.     pp_AirBrush 100 trunc(AB)
  480.     pp_CircleF x1 y1 r/2.5
  481.  
  482.     if RayShade >0 then DO
  483.         pp_Shade RayShade
  484.         pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  485.     END
  486. RETURN
  487.  
  488. /*********************************************************/
  489. /*                       Draw Ray                        */
  490. /*********************************************************/
  491.  
  492. DrawRays: PROCEDURE EXPOSE x1 y1 r Pi totalR RayShade
  493. RN=abs(x1*y1)+totalR*RayShade
  494. pp_Compose 0 100 0
  495. pp_EffectOff
  496. aa=random(100,200,RN)
  497. DO j=1 to 5
  498.     aa=aa/2
  499.     a=360/aa
  500.     a2=a/2    
  501.   DO i=aa To 359+aa by a
  502.         r3=totalR
  503.     x = Sin(i*Pi)*r3+x1
  504.     y = Cos(i*Pi)*r3+y1
  505.         pp_line x1 y1 x y
  506.     END
  507.     pp_EffectOn
  508.     pp_ConvInit 0 9 0
  509.     pp_Conv 0 1 1 1 1 1
  510.     pp_Conv 1 1 1 1 1 1
  511.     pp_Conv 2 1 1 1 1 1
  512.     pp_Conv 3 1 1 1 1 1
  513.     pp_Conv 4 1 1 1 1 1    
  514.     pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  515.     pp_EffectOff
  516. END    
  517.  
  518.     pp_EffectOn
  519.     pp_Gradient 10 2 x1 y1
  520.     pp_ClearRange 10
  521.     pp_setRange 10 0 0 0 0
  522.     pp_setRange 10 10 0 0 0
  523.     pp_setRange 10 16 255 255 255
  524.     pp_setRange 10 19 255 255 255
  525.     pp_Compose 4 100 0
  526.     pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  527.  
  528.     if RayShade >0 then DO
  529.     pp_Shade RayShade
  530.     pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  531.     END
  532.  
  533.     pp_EffectOff
  534.  
  535. RETURN
  536.  
  537.  
  538. /*********************************************************/
  539. /*                       Draw Rings                   */
  540. /*********************************************************/
  541.  
  542. DrawRings: PROCEDURE EXPOSE x1 y1 r
  543.         pp_EffectOn
  544.         pp_Compose 1 100 0    
  545.         pp_Gradient 10 2 x1 y1
  546.         pp_ClearRange 10
  547.         pp_setRange 10 0 0 0 0
  548.         pp_setRange 10 5 0 0 0
  549.         pp_setRange 10 6 48 0 0
  550.         pp_setRange 10 7 0 0 0
  551.         pp_setRange 10 13 48 0 0
  552.         pp_setRange 10 19 0 0 0
  553.  
  554.         pp_CircleF x1 y1 r
  555.  
  556. RETURN
  557.  
  558.  
  559. /*********************************************************/
  560. /*                       Draw artifact                   */
  561. /*********************************************************/
  562.  
  563. DrawArtefacts: PROCEDURE EXPOSE x1 y1 r totalR Arti
  564.  
  565.     pp_GetWidth
  566.     cx=trunc(result/2)
  567.     pp_GetHeight
  568.     cy=trunc(result/2)
  569.  
  570. if Arti=1 then do
  571. Nb_Spot=15
  572. t.1=1;s.1=25;d.1=123;c.1=15;r.1=255;g.1=255;b.1=255
  573. t.2=3;s.2=60;d.2=100;c.2=15;r.2=255;g.2=20;b.2=0
  574. t.3=1;s.3=13;d.3=58;c.3=10;r.3=160;g.3=160;b.3=255
  575. t.4=2;s.4=33;d.4=54;c.4=5;r.4=160;g.4=160;b.4=255
  576. t.5=2;s.5=16;d.5=50;c.5=10;r.5=160;g.5=160;b.5=255
  577. t.6=2;s.6=10;d.6=30;c.6=20;r.6=255;g.6=160;b.6=25
  578. t.7=4;s.7=4;d.7=18;c.7=50;r.7=255;g.7=255;b.7=255
  579. t.8=4;s.8=6;d.8=-4;c.8=50;r.8=255;g.8=255;b.8=255
  580. t.9=1;s.9=23;d.9=-15;c.9=12;r.9=255;g.9=160;b.9=25
  581. t.10=1;s.10=44;d.10=-18;c.10=12;r.10=255;g.10=160;b.10=25
  582. t.11=1;s.11=10;d.11=-21;c.11=12;r.11=255;g.11=160;b.11=25
  583. t.12=1;s.12=15;d.12=-36;c.12=15;r.12=145;g.12=255;b.12=145
  584. t.13=2;s.13=8;d.13=-40;c.13=20;r.13=100;g.13=120;b.13=255
  585. t.14=3;s.14=63;d.14=-67;c.14=12;r.14=145;g.14=255;b.14=145
  586. t.15=5;s.15=133;d.15=-100;c.15=10;r.15=255;g.15=255;b.15=255
  587. end
  588.  
  589. if Arti=2 then do
  590. Nb_Spot=25
  591. t.1=1;s.1=21;d.1=86;c.1=16;r.1=210;g.1=250;b.1=255
  592. t.2=4;s.2=18;d.2=77;c.2=20;r.2=60;g.2=50;b.2=230
  593. t.3=1;s.3=16;d.3=69;c.3=25;r.3=220;g.3=220;b.3=235
  594. t.4=4;s.4=18;d.4=61;c.4=12;r.4=220;g.4=245;b.4=245
  595. t.5=1;s.5=17;d.5=51;c.5=18;r.5=50;g.5=80;b.5=250
  596. t.6=1;s.6=18;d.6=42;c.6=26;r.6=225;g.6=210;b.6=250
  597. t.7=4;s.7=16;d.7=33;c.7=18;r.7=55;g.7=55;b.7=245
  598. t.8=1;s.8=12;d.8=23;c.8=21;r.8=60;g.8=50;b.8=255
  599. t.9=1;s.9=9;d.9=15;c.9=30;r.9=210;g.9=227;b.9=250
  600. t.10=4;s.10=6;d.10=7;c.10=18;r.10=55;g.10=55;b.10=255
  601. t.11=4;s.11=7;d.11=1;c.11=23;r.11=250;g.11=225;b.11=255
  602. t.12=1;s.12=5;d.12=-9;c.12=14;r.12=60;g.12=50;b.12=255
  603. t.13=1;s.13=6;d.13=-17;c.13=21;r.13=50;g.13=50;b.13=235
  604. t.14=1;s.14=9;d.14=-27;c.14=24;r.14=210;g.14=230;b.14=250
  605. t.15=4;s.15=11;d.15=-32;c.15=23;r.15=225;g.15=225;b.15=255
  606. t.16=1;s.16=16;d.16=-41;c.16=13;r.16=60;g.16=50;b.16=245
  607. t.17=4;s.17=17;d.17=-53;c.17=21;r.17=80;g.17=50;b.17=230
  608. t.18=4;s.18=15;d.18=-60;c.18=25;r.18=215;g.18=210;b.18=235
  609. t.19=1;s.19=19;d.19=-71;c.19=15;r.19=60;g.19=55;b.19=225
  610. t.20=1;s.20=19;d.20=-84;c.20=19;r.20=240;g.20=240;b.20=245
  611. t.21=4;s.21=19;d.21=-92;c.21=22;r.21=90;g.21=55;b.21=225
  612. t.22=1;s.22=27;d.22=-103;c.22=20;r.22=60;g.22=60;b.22=255
  613. t.23=4;s.23=30;d.23=-115;c.23=16;r.23=210;g.23=225;b.23=255
  614. t.24=1;s.24=26;d.24=-123;c.24=21;r.24=55;g.24=55;b.24=245
  615. t.25=1;s.25=34;d.25=-135;c.25=23;r.25=50;g.25=50;b.25=255
  616. end
  617.  
  618. if Arti=3 then do
  619. Nb_Spot=25
  620. t.1=1;s.1=21;d.1=86;c.1=16;r.1=210;g.1=250;b.1=255
  621. t.2=4;s.2=18;d.2=77;c.2=20;r.2=60;g.2=150;b.2=230
  622. t.3=1;s.3=16;d.3=69;c.3=25;r.3=220;g.3=220;b.3=235
  623. t.4=4;s.4=18;d.4=61;c.4=12;r.4=220;g.4=245;b.4=245
  624. t.5=1;s.5=17;d.5=51;c.5=18;r.5=50;g.5=180;b.5=250
  625. t.6=1;s.6=18;d.6=42;c.6=26;r.6=225;g.6=210;b.6=250
  626. t.7=4;s.7=16;d.7=33;c.7=18;r.7=55;g.7=155;b.7=245
  627. t.8=1;s.8=12;d.8=23;c.8=21;r.8=50;g.8=250;b.8=255
  628. t.9=1;s.9=9;d.9=15;c.9=30;r.9=210;g.9=227;b.9=250
  629. t.10=4;s.10=6;d.10=7;c.10=18;r.10=55;g.10=155;b.10=255
  630. t.11=4;s.11=7;d.11=1;c.11=23;r.11=250;g.11=225;b.11=255
  631. t.12=1;s.12=5;d.12=-9;c.12=14;r.12=60;g.12=150;b.12=255
  632. t.13=1;s.13=6;d.13=-17;c.13=21;r.13=150;g.13=150;b.13=235
  633. t.14=2;s.14=9;d.14=-27;c.14=24;r.14=210;g.14=230;b.14=250
  634. t.15=4;s.15=11;d.15=-32;c.15=23;r.15=225;g.15=225;b.15=255
  635. t.16=1;s.16=16;d.16=-41;c.16=13;r.16=60;g.16=150;b.16=245
  636. t.17=4;s.17=17;d.17=-53;c.17=21;r.17=80;g.17=150;b.17=230
  637. t.18=4;s.18=15;d.18=-60;c.18=25;r.18=215;g.18=210;b.18=235
  638. t.19=1;s.19=19;d.19=-71;c.19=15;r.19=60;g.19=155;b.19=225
  639. t.20=1;s.20=19;d.20=-84;c.20=19;r.20=240;g.20=240;b.20=245
  640. t.21=4;s.21=19;d.21=-92;c.21=22;r.21=90;g.21=155;b.21=225
  641. t.22=1;s.22=27;d.22=-103;c.22=20;r.22=60;g.22=160;b.22=255
  642. t.23=4;s.23=30;d.23=-115;c.23=16;r.23=210;g.23=225;b.23=255
  643. t.24=1;s.24=26;d.24=-123;c.24=21;r.24=255;g.24=255;b.24=255
  644. t.25=1;s.25=34;d.25=-135;c.25=23;r.25=50;g.25=150;b.25=255
  645. end
  646.  
  647.     pp_Compose 1 100 0    
  648.  
  649.     DO i=1 TO Nb_Spot
  650.     spot_size = trunc((r*s.i)/100)
  651.     spot_x  = ((x1 - cx) * d.i)/100 + cx
  652.     spot_y = ((y1 - cy) * d.i)/100 + cy
  653.  
  654.         spot_r = ((r.i*c.i)/100)
  655.         spot_g = ((g.i*c.i)/100)    
  656.         spot_b = ((b.i*c.i)/100)
  657.  
  658.         pp_Gradient 10 2 spot_x spot_y
  659.  
  660.         pp_ClearRange 10
  661.         
  662.         SELECT
  663.             WHEN t.i=1 then DO
  664.                 pp_setRange 10 0 0 0 0 0
  665.         pp_setRange 10 5 0 0 0
  666.         pp_setRange 10 7 spot_r spot_g spot_b
  667.                 pp_setRange 10 15 0 0 0
  668.                 pp_setRange 10 19 0 0 0
  669.       END
  670.             WHEN t.i=2 then DO
  671.                 pp_setRange 10 0 0 0 0 0
  672.         pp_setRange 10 5 0 0 0
  673.         pp_setRange 10 7 spot_r spot_g spot_b
  674.         pp_setRange 10 19 spot_r spot_g spot_b
  675.             END
  676.             WHEN t.i=3 then DO
  677.                 pp_setRange 10 0 0 0 0 0
  678.         pp_setRange 10 5 0 0 0
  679.         pp_setRange 10 6 spot_r spot_g spot_b
  680.         pp_setRange 10 8 0 0 0
  681.                 pp_setRange 10 19 0 0 0
  682.             END
  683.             WHEN t.i=4 then DO
  684.                 pp_setRange 10 0 0 0 0 0
  685.         pp_setRange 10 5 0 0 0
  686.         pp_setRange 10 16 spot_r spot_g spot_b
  687.         pp_setRange 10 19 spot_r spot_g spot_b
  688.             END
  689.             WHEN t.i=5 then DO
  690.                 spot_r = ((255*c.i)/100)
  691.                 pp_setRange 10 0 0 0 0 0
  692.         pp_setRange 10 5 0 0 0
  693.         pp_setRange 10 6 spot_r 0 0
  694.         pp_setRange 10 7 0 spot_r 0
  695.         pp_setRange 10 8 0 0 spot_r
  696.         pp_setRange 10 9 0 0 0
  697.                 pp_setRange 10 19 0 0 0
  698.             END
  699.         END        
  700.  
  701.         pp_CircleF spot_x spot_y spot_size
  702.  
  703.     END
  704.  
  705. RETURN
  706.     
  707.